<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″/>
    <link rel="stylesheet" type="text/css" href="../../css/defaultcss.css" />
    <link rel="stylesheet" type="text/css" href="../../css/amazeui.min.css" />
    <script type="text/javascript" src="../../js/jquery-1.9.1.min.js"></script>
    <script src='../../js/amazeui.min.js'></script>
    <script src='../../js/flex.js'></script>
    <script type="text/javascript" src="../../js/index.js"></script>
    <link rel="stylesheet" href="../../css/weui.min.css">
    <link rel="stylesheet" href="../../css/css/stylesheets/index.css">

</head>

<body>
    <header>
        <div class="goBack">
            <img src="../../img/base/back.png" alt="返回">
        </div>
        <span class="title"> 线索详情 </span>
    </header>
    <div class="content  lawsuit_form">
        <div id="fform">
            <ul class="form_ul">
                <li class="">
                    <label for="">姓名</label>
                    <div class="msg" id="litName">
                    </div>
                </li>
                <li class="">
                    <label for="">手机号</label>
                    <div class="msg" id="litMobile">
                    </div>
                </li>
                <li class="type ">
                    <label for="contractType">线索类型</label>
                    <div class="msg" id="litType">
                    </div>
                </li>
                <li class="type ">
                    <label for="contractType">线索名称</label>
                    <div class="msg" id="title">
                    </div>
                </li>
                <li class="tips">
                    <div class="msg1" id="content">
                        相关线索
                    </div>
                </li>
                <li class="other1">
                    <div class="icon">
                        <i><img src="../../img/lawsuit/map.png" alt=""></i><span id="address"></span>
                    </div>
                    <div id="createTime">
                    </div>
                </li>
                <li class="img_box" id="img_box">
                </li>
                <li class="video" id="video">
                    <video width="100%" height="100%" controls>
                    </video>
                </li>
                <li class=" result">
                    <label for="contractType">处理结果</label>
                    <div class="msg" id="processingResult">
                    </div>
                </li>
            </ul>
        </div>
    </div>

</body>

</html>

<script type="text/javascript ">
    $('.goBack').bind('click', function () {
        window.history.back()
    })
    var getData = function (id) {
        HYIP.ajax({
            url: '/litigation/queryLitigation.action',
            type: 'get',
            data: {
                id: id
            }
        }, function (data) {
            var detail = data.data;
            $('#litName').text(detail.litName);
            $('#litMobile').text(detail.litMobile);
            //litType  线索类型   1.国土资源；2.环境保护；3.食药安全；4.国有财产；5.工商地税；6.住建；7.其他
            var litType;
            switch (parseInt(detail.litType)) {
                case 1:
                    litType = "国土资源";
                    break;
                case 2:
                    litType = "环境保护";
                    break;
                case 3:
                    litType = "食药安全";
                    break;
                case 4:
                    litType = "国有财产";
                    break;
                case 5:
                    litType = "工商地税";
                    break;
                case 6:
                    litType = "住建";
                    break;
                case 7:
                    litType = "其他";
                    break;
            }
            $('#litType').text(litType);
            $('#title').text(detail.title);
            $('#content').text(detail.content);
            $('#address').text(detail.address);
            $('#createTime').text(detail.createTime);
            var fileList = detail.fileList; // 文件列表  fileType  1:图片 2:视频
            var imgList = ''
            for (var k = 0; k < fileList.length; k++) {
                if (fileList[k].fileType == 1) {
                    imgList += '<div class="img">                                         ' +
                        '    <img src="' + fileList[k].filePath + '" alt="">         ' +
                        '</div>                                                    '
                } else {
                    var type = fileList[k].filePath.substring(fileList[k].filePath.lastIndexOf('.') + 1,
                        fileList[k].filePath.length);
                    $('#video video').append('<source src="' + fileList[k].filePath +
                        '" type="video / ' + type + ' ">   ' +
                        '您的浏览器不支持 video 标签。               ')
                }
                $("#img_box").append(imgList);
            }
            var processingResult; //处理结果文案  只有caseType==3时才有对应文案
            //caseType  案件状态  1.待处理;2.处理中;3.已处理
            switch (parseInt(detail.caseType)) {
                case 1:
                    processingResult = "待处理";
                    break;
                case 2:
                    processingResult = "处理中";
                    break;
                case 3:
                    processingResult = detail.processingResult;
                    break;
            }
            $('#processingResult').text(processingResult);
        });
    }

    function GetRequest() {
        var url = location.search; //获取url中"?"符后的字串
        var theRequest = new Object();
        if (url.indexOf("?") != -1) {
            var str = url.substr(1);
            strs = str.split("&");
            for (var i = 0; i < strs.length; i++) {
                theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
            }
        }
        return theRequest;
    }
    getData(GetRequest()['id']);
    console.log(GetRequest()['id'])
</script>